/*
 *  jarvismarch.h
 *  bgsubtraction
 *
 *  Created by a1gucis on 5/18/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef JARVIS_MARCH_H
#define JARVIS_MARCH_H
#include "contourpixel.h"
#include <vector.h>
#include <math.h>
using namespace std; 
class JarvisMarch {
private:
	static int eucDistSquared(int row1, int col1, int row2, int col2);
	static void findFarthestPoints(vector<int> *rowVector, vector<int> *columnVector, int &row1, int &col1, int &row2, int &col2);
	static bool findHullPoint(vector<int> *rowVector, vector<int> *columnVector, bool right, int mainRow, int mainCol, int &nextRow, int &nextCol);
	
public:
	JarvisMarch();
	static void findConvexHull(vector<int> *rowVector, vector<int> *columnVector, vector<ContourPixel *> *hullPixels, int numberOfPixels);
};

#endif
